home *** CD-ROM | disk | FTP | other *** search
/ Gigarom 4 / Mac Giga-ROM 4.0 - 1993.toast / FILES / COM / Q-Z / Terminal 2.2.sit / Terminal 2.2 / Project / Sources / CRC.c < prev    next >
MacBinary  |  1992-01-17  |  4.9 KB  |  [TEXT/KAHL]

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: MacBinary (archive/macBinary).

ConfidenceProgramDetectionMatch TypeSupport
66% dexvert Compact Compressed (Unix) (archive/compact) ext Supported
10% dexvert MacBinary (archive/macBinary) fallback Supported
10% dexvert Jesper Olsen Module (music/jesperOlsen) magic Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, Fri Jan 17 12:00:00 1992, modified Fri Jan 17 12:00:00 1992, creator Think C, type ASCII, 4412 bytes "CRC.c" , at 0x11bc 380 bytes resource default (weak)
99% file data default
49% TrID Macintosh plain text (MacBinary) default
33% TrID TTComp archive compressed (bin-2K) default (weak)
16% TrID MacBinary 2 default (weak)
0% TrID Sybase iAnywhere database files default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[KAHL]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 05 43 52 43 2e 63 00 | 00 00 00 00 00 00 00 00 |..CRC.c.|........|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4b 41 48 | 4c 00 00 00 00 00 00 00 |.TEXTKAH|L.......|
|00000050| 00 00 00 00 00 11 3c 00 | 00 01 7c a5 9c bc 10 a5 |......<.|..|.....|
|00000060| 9c bc 10 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 75 8a 00 00 |........|....u...|
|00000080| 2f 2a 0d 09 54 65 72 6d | 69 6e 61 6c 20 32 2e 32 |/*..Term|inal 2.2|
|00000090| 0d 09 22 43 52 43 2e 63 | 22 0d 0d 09 44 65 66 69 |.."CRC.c|"...Defi|
|000000a0| 6e 65 20 73 79 6d 62 6f | 6c 20 53 4c 4f 57 20 74 |ne symbo|l SLOW t|
|000000b0| 6f 20 75 73 65 20 74 68 | 65 20 73 6c 6f 77 2c 20 |o use th|e slow, |
|000000c0| 62 75 74 20 6d 6f 72 65 | 20 73 70 61 63 65 20 65 |but more| space e|
|000000d0| 66 66 65 63 74 69 76 65 | 20 66 75 6e 63 74 69 6f |ffective| functio|
|000000e0| 6e 2e 0d 09 4f 74 68 65 | 72 77 69 73 65 20 74 68 |n...Othe|rwise th|
|000000f0| 65 20 66 61 73 74 20 66 | 75 6e 63 74 69 6f 6e 20 |e fast f|unction |
|00000100| 77 69 6c 6c 20 62 65 20 | 75 73 65 64 2e 20 45 78 |will be |used. Ex|
|00000110| 65 63 75 74 69 6f 6e 20 | 74 69 6d 65 73 20 66 6f |ecution |times fo|
|00000120| 72 20 61 20 31 30 32 34 | 0d 09 62 79 74 65 20 62 |r a 1024|..byte b|
|00000130| 6c 6f 63 6b 20 61 72 65 | 3a 0d 0d 09 09 09 09 4d |lock are|:......M|
|00000140| 61 63 20 50 6c 75 73 09 | 09 4d 61 63 20 49 49 63 |ac Plus.|.Mac IIc|
|00000150| 78 0d 09 09 73 6c 6f 77 | 09 31 31 38 20 20 20 6d |x...slow|.118 m|
|00000160| 73 09 09 32 30 2e 31 20 | 20 6d 73 0d 09 09 66 61 |s..20.1 | ms...fa|
|00000170| 73 74 09 20 32 39 2e 36 | 20 6d 73 09 09 20 34 2e |st. 29.6| ms.. 4.|
|00000180| 37 30 20 6d 73 0d 2a 2f | 0d 0d 23 69 66 64 65 66 |70 ms.*/|..#ifdef|
|00000190| 20 54 48 49 4e 4b 5f 43 | 0d 23 69 6e 63 6c 75 64 | THINK_C|.#includ|
|000001a0| 65 20 22 4d 61 63 48 65 | 61 64 65 72 73 22 0d 23 |e "MacHe|aders".#|
|000001b0| 65 6e 64 69 66 0d 23 69 | 66 64 65 66 20 61 70 70 |endif.#i|fdef app|
|000001c0| 6c 65 63 0d 23 70 72 61 | 67 6d 61 20 6c 6f 61 64 |lec.#pra|gma load|
|000001d0| 20 22 3a 28 4f 62 6a 65 | 63 74 73 29 3a 4d 61 63 | ":(Obje|cts):Mac|
|000001e0| 48 65 61 64 65 72 73 4d | 50 57 22 0d 23 70 72 61 |HeadersM|PW".#pra|
|000001f0| 67 6d 61 20 73 65 67 6d | 65 6e 74 20 4d 61 69 6e |gma segm|ent Main|
|00000200| 32 0d 23 65 6e 64 69 66 | 0d 0d 23 69 6e 63 6c 75 |2.#endif|..#inclu|
|00000210| 64 65 20 22 43 52 43 2e | 68 22 0d 0d 23 69 66 64 |de "CRC.|h"..#ifd|
|00000220| 65 66 20 53 4c 4f 57 0d | 0d 2f 2a 0d 09 43 52 43 |ef SLOW.|./*..CRC|
|00000230| 20 43 61 6c 63 75 6c 61 | 74 69 6f 6e 0d 0d 09 54 | Calcula|tion...T|
|00000240| 6f 20 63 61 6c 63 75 6c | 61 74 65 20 74 68 65 20 |o calcul|ate the |
|00000250| 31 36 20 62 69 74 20 43 | 52 43 20 74 68 65 20 6d |16 bit C|RC the m|
|00000260| 65 73 73 61 67 65 20 62 | 69 74 73 20 61 72 65 20 |essage b|its are |
|00000270| 63 6f 6e 73 69 64 65 72 | 65 64 20 74 6f 20 62 65 |consider|ed to be|
|00000280| 20 74 68 65 0d 09 63 6f | 65 66 66 69 63 69 65 6e | the..co|efficien|
|00000290| 74 73 20 6f 66 20 61 20 | 70 6f 6c 79 6e 6f 6d 69 |ts of a |polynomi|
|000002a0| 61 6c 2e 20 54 68 69 73 | 20 6d 65 73 73 61 67 65 |al. This| message|
|000002b0| 20 70 6f 6c 79 6e 6f 6d | 69 61 6c 20 69 73 20 66 | polynom|ial is f|
|000002c0| 69 72 73 74 0d 09 6d 75 | 6c 74 69 70 6c 69 65 64 |irst..mu|ltiplied|
|000002d0| 20 62 79 20 58 5e 31 36 | 20 61 6e 64 20 74 68 65 | by X^16| and the|
|000002e0| 6e 20 64 69 76 69 64 65 | 64 20 62 79 20 74 68 65 |n divide|d by the|
|000002f0| 20 67 65 6e 65 72 61 74 | 6f 72 20 70 6f 6c 79 6e | generat|or polyn|
|00000300| 6f 6d 69 61 6c 0d 09 28 | 58 5e 31 36 20 2b 20 58 |omial..(|X^16 + X|
|00000310| 5e 31 32 20 2b 20 58 5e | 35 20 2b 20 31 29 20 75 |^12 + X^|5 + 1) u|
|00000320| 73 69 6e 67 20 6d 6f 64 | 75 6c 6f 20 74 77 6f 20 |sing mod|ulo two |
|00000330| 61 72 69 74 68 6d 65 74 | 69 63 2e 20 54 68 65 20 |arithmet|ic. The |
|00000340| 72 65 6d 61 69 6e 64 65 | 72 20 6c 65 66 74 0d 09 |remainde|r left..|
|00000350| 61 66 74 65 72 20 74 68 | 65 20 64 69 76 69 73 69 |after th|e divisi|
|00000360| 6f 6e 20 69 73 20 74 68 | 65 20 64 65 73 69 72 65 |on is th|e desire|
|00000370| 64 20 43 52 43 2e 20 53 | 69 6e 63 65 20 61 20 6d |d CRC. S|ince a m|
|00000380| 65 73 73 61 67 65 20 62 | 6c 6f 63 6b 20 69 6e 20 |essage b|lock in |
|00000390| 74 68 65 0d 09 4d 6f 64 | 65 6d 20 50 72 6f 74 6f |the..Mod|em Proto|
|000003a0| 63 6f 6c 20 69 73 20 31 | 32 38 20 62 79 74 65 73 |col is 1|28 bytes|
|000003b0| 20 6f 72 20 31 30 32 34 | 20 62 69 74 73 2c 20 74 | or 1024| bits, t|
|000003c0| 68 65 20 6d 65 73 73 61 | 67 65 20 70 6f 6c 79 6e |he messa|ge polyn|
|000003d0| 6f 6d 69 61 6c 20 77 69 | 6c 6c 0d 09 62 65 20 6f |omial wi|ll..be o|
|000003e0| 66 20 6f 72 64 65 72 20 | 58 5e 31 30 32 33 2e 20 |f order |X^1023. |
|000003f0| 54 68 65 20 68 69 20 6f | 72 64 65 72 20 62 69 74 |The hi o|rder bit|
|00000400| 20 6f 66 20 74 68 65 20 | 66 69 72 73 74 20 62 79 | of the |first by|
|00000410| 74 65 20 6f 66 20 74 68 | 65 20 6d 65 73 73 61 67 |te of th|e messag|
|00000420| 65 0d 09 62 6c 6f 63 6b | 20 69 73 20 74 68 65 20 |e..block| is the |
|00000430| 63 6f 65 66 66 69 63 69 | 65 6e 74 20 6f 66 20 58 |coeffici|ent of X|
|00000440| 5e 31 30 32 33 20 69 6e | 20 74 68 65 20 6d 65 73 |^1023 in| the mes|
|00000450| 73 61 67 65 20 70 6f 6c | 79 6e 6f 6d 69 61 6c 2e |sage pol|ynomial.|
|00000460| 20 54 68 65 20 6c 6f 0d | 09 6f 72 64 65 72 20 62 | The lo.|.order b|
|00000470| 69 74 20 6f 66 20 74 68 | 65 20 6c 61 73 74 20 62 |it of th|e last b|
|00000480| 79 74 65 20 6f 66 20 74 | 68 65 20 6d 65 73 73 61 |yte of t|he messa|
|00000490| 67 65 20 62 6c 6f 63 6b | 20 69 73 20 74 68 65 20 |ge block| is the |
|000004a0| 63 6f 65 66 66 69 63 69 | 65 6e 74 20 6f 66 0d 09 |coeffici|ent of..|
|000004b0| 58 5e 30 20 69 6e 20 74 | 68 65 20 6d 65 73 73 61 |X^0 in t|he messa|
|000004c0| 67 65 20 70 6f 6c 79 6e | 6f 6d 69 61 6c 2e 0d 0d |ge polyn|omial...|
|000004d0| 09 54 68 69 73 20 66 75 | 6e 63 74 69 6f 6e 20 63 |.This fu|nction c|
|000004e0| 61 6c 63 75 6c 61 74 65 | 73 20 74 68 65 20 43 52 |alculate|s the CR|
|000004f0| 43 20 75 73 65 64 20 62 | 79 20 74 68 65 20 58 4d |C used b|y the XM|
|00000500| 4f 44 45 4d 2f 43 52 43 | 20 50 72 6f 74 6f 63 6f |ODEM/CRC| Protoco|
|00000510| 6c 2e 0d 09 54 68 65 20 | 66 69 72 73 74 20 61 72 |l...The |first ar|
|00000520| 67 75 6d 65 6e 74 20 69 | 73 20 61 20 70 6f 69 6e |gument i|s a poin|
|00000530| 74 65 72 20 74 6f 20 74 | 68 65 20 6d 65 73 73 61 |ter to t|he messa|
|00000540| 67 65 20 62 6c 6f 63 6b | 2e 0d 09 54 68 65 20 73 |ge block|...The s|
|00000550| 65 63 6f 6e 64 20 61 72 | 67 75 6d 65 6e 74 20 69 |econd ar|gument i|
|00000560| 73 20 74 68 65 20 6e 75 | 6d 62 65 72 20 6f 66 20 |s the nu|mber of |
|00000570| 62 79 74 65 73 20 69 6e | 20 74 68 65 20 6d 65 73 |bytes in| the mes|
|00000580| 73 61 67 65 20 62 6c 6f | 63 6b 2e 0d 09 54 68 65 |sage blo|ck...The|
|00000590| 20 66 75 6e 63 74 69 6f | 6e 20 72 65 74 75 72 6e | functio|n return|
|000005a0| 73 20 61 6e 20 69 6e 74 | 65 67 65 72 20 77 68 69 |s an int|eger whi|
|000005b0| 63 68 20 63 6f 6e 74 61 | 69 6e 73 20 74 68 65 20 |ch conta|ins the |
|000005c0| 43 52 43 2e 0d 2a 2f 0d | 0d 75 6e 73 69 67 6e 65 |CRC..*/.|.unsigne|
|000005d0| 64 20 73 68 6f 72 74 20 | 43 61 6c 63 43 52 43 28 |d short |CalcCRC(|
|000005e0| 0d 09 72 65 67 69 73 74 | 65 72 20 42 79 74 65 20 |..regist|er Byte |
|000005f0| 2a 70 74 72 2c 0d 09 72 | 65 67 69 73 74 65 72 20 |*ptr,..r|egister |
|00000600| 75 6e 73 69 67 6e 65 64 | 20 6c 6f 6e 67 20 63 6f |unsigned| long co|
|00000610| 75 6e 74 2c 0d 09 72 65 | 67 69 73 74 65 72 20 75 |unt,..re|gister u|
|00000620| 6e 73 69 67 6e 65 64 20 | 73 68 6f 72 74 20 63 72 |nsigned |short cr|
|00000630| 63 29 0d 7b 0d 09 72 65 | 67 69 73 74 65 72 20 75 |c).{..re|gister u|
|00000640| 6e 73 69 67 6e 65 64 20 | 73 68 6f 72 74 20 69 3b |nsigned |short i;|
|00000650| 0d 0d 09 63 72 63 20 3d | 20 30 3b 0d 09 77 68 69 |...crc =| 0;..whi|
|00000660| 6c 65 20 28 63 6f 75 6e | 74 2d 2d 20 3e 20 30 29 |le (coun|t-- > 0)|
|00000670| 20 7b 0d 09 09 63 72 63 | 20 3d 20 63 72 63 20 5e | {...crc| = crc ^|
|00000680| 20 28 75 6e 73 69 67 6e | 65 64 20 73 68 6f 72 74 | (unsign|ed short|
|00000690| 29 2a 70 74 72 2b 2b 20 | 3c 3c 20 38 3b 0d 09 09 |)*ptr++ |<< 8;...|
|000006a0| 66 6f 72 20 28 69 20 3d | 20 30 3b 20 69 20 3c 20 |for (i =| 0; i < |
|000006b0| 38 3b 20 2b 2b 69 29 0d | 09 09 09 69 66 20 28 63 |8; ++i).|...if (c|
|000006c0| 72 63 20 26 20 30 78 38 | 30 30 30 29 0d 09 09 09 |rc & 0x8|000)....|
|000006d0| 09 63 72 63 20 3d 20 63 | 72 63 20 3c 3c 20 31 20 |.crc = c|rc << 1 |
|000006e0| 5e 20 30 78 31 30 32 31 | 3b 0d 09 09 09 65 6c 73 |^ 0x1021|;....els|
|000006f0| 65 0d 09 09 09 09 63 72 | 63 20 3d 20 63 72 63 20 |e.....cr|c = crc |
|00000700| 3c 3c 20 31 3b 0d 09 7d | 0d 09 72 65 74 75 72 6e |<< 1;..}|..return|
|00000710| 20 63 72 63 3b 0d 7d 0d | 0d 75 6e 73 69 67 6e 65 | crc;.}.|.unsigne|
|00000720| 64 20 73 68 6f 72 74 20 | 55 70 64 61 74 65 43 52 |d short |UpdateCR|
|00000730| 43 28 0d 09 72 65 67 69 | 73 74 65 72 20 42 79 74 |C(..regi|ster Byt|
|00000740| 65 20 62 2c 0d 09 72 65 | 67 69 73 74 65 72 20 75 |e b,..re|gister u|
|00000750| 6e 73 69 67 6e 65 64 20 | 73 68 6f 72 74 20 63 72 |nsigned |short cr|
|00000760| 63 29 0d 7b 0d 09 72 65 | 67 69 73 74 65 72 20 75 |c).{..re|gister u|
|00000770| 6e 73 69 67 6e 65 64 20 | 73 68 6f 72 74 20 69 3b |nsigned |short i;|
|00000780| 0d 0d 09 63 72 63 20 3d | 20 63 72 63 20 5e 20 28 |...crc =| crc ^ (|
|00000790| 75 6e 73 69 67 6e 65 64 | 20 73 68 6f 72 74 29 62 |unsigned| short)b|
|000007a0| 20 3c 3c 20 38 3b 0d 09 | 66 6f 72 20 28 69 20 3d | << 8;..|for (i =|
|000007b0| 20 30 3b 20 69 20 3c 20 | 38 3b 20 2b 2b 69 29 0d | 0; i < |8; ++i).|
|000007c0| 09 09 69 66 20 28 63 72 | 63 20 26 20 30 78 38 30 |..if (cr|c & 0x80|
|000007d0| 30 30 29 0d 09 09 09 63 | 72 63 20 3d 20 63 72 63 |00)....c|rc = crc|
|000007e0| 20 3c 3c 20 31 20 5e 20 | 30 78 31 30 32 31 3b 0d | << 1 ^ |0x1021;.|
|000007f0| 09 09 65 6c 73 65 0d 09 | 09 09 63 72 63 20 3d 20 |..else..|..crc = |
|00000800| 63 72 63 20 3c 3c 20 31 | 3b 0d 09 72 65 74 75 72 |crc << 1|;..retur|
|00000810| 6e 20 63 72 63 3b 0d 7d | 0d 0d 23 65 6c 73 65 0d |n crc;.}|..#else.|
|00000820| 0d 73 74 61 74 69 63 20 | 75 6e 73 69 67 6e 65 64 |.static |unsigned|
|00000830| 20 73 68 6f 72 74 20 54 | 61 62 6c 65 5b 5d 20 3d | short T|able[] =|
|00000840| 20 7b 0d 09 30 78 30 30 | 30 30 2c 20 30 78 31 30 | {..0x00|00, 0x10|
|00000850| 32 31 2c 20 30 78 32 30 | 34 32 2c 20 30 78 33 30 |21, 0x20|42, 0x30|
|00000860| 36 33 2c 20 30 78 34 30 | 38 34 2c 20 30 78 35 30 |63, 0x40|84, 0x50|
|00000870| 41 35 2c 20 30 78 36 30 | 43 36 2c 20 30 78 37 30 |A5, 0x60|C6, 0x70|
|00000880| 45 37 2c 0d 09 30 78 38 | 31 30 38 2c 20 30 78 39 |E7,..0x8|108, 0x9|
|00000890| 31 32 39 2c 20 30 78 41 | 31 34 41 2c 20 30 78 42 |129, 0xA|14A, 0xB|
|000008a0| 31 36 42 2c 20 30 78 43 | 31 38 43 2c 20 30 78 44 |16B, 0xC|18C, 0xD|
|000008b0| 31 41 44 2c 20 30 78 45 | 31 43 45 2c 20 30 78 46 |1AD, 0xE|1CE, 0xF|
|000008c0| 31 45 46 2c 0d 09 30 78 | 31 32 33 31 2c 20 30 78 |1EF,..0x|1231, 0x|
|000008d0| 30 32 31 30 2c 20 30 78 | 33 32 37 33 2c 20 30 78 |0210, 0x|3273, 0x|
|000008e0| 32 32 35 32 2c 20 30 78 | 35 32 42 35 2c 20 30 78 |2252, 0x|52B5, 0x|
|000008f0| 34 32 39 34 2c 20 30 78 | 37 32 46 37 2c 20 30 78 |4294, 0x|72F7, 0x|
|00000900| 36 32 44 36 2c 0d 09 30 | 78 39 33 33 39 2c 20 30 |62D6,..0|x9339, 0|
|00000910| 78 38 33 31 38 2c 20 30 | 78 42 33 37 42 2c 20 30 |x8318, 0|xB37B, 0|
|00000920| 78 41 33 35 41 2c 20 30 | 78 44 33 42 44 2c 20 30 |xA35A, 0|xD3BD, 0|
|00000930| 78 43 33 39 43 2c 20 30 | 78 46 33 46 46 2c 20 30 |xC39C, 0|xF3FF, 0|
|00000940| 78 45 33 44 45 2c 0d 09 | 30 78 32 34 36 32 2c 20 |xE3DE,..|0x2462, |
|00000950| 30 78 33 34 34 33 2c 20 | 30 78 30 34 32 30 2c 20 |0x3443, |0x0420, |
|00000960| 30 78 31 34 30 31 2c 20 | 30 78 36 34 45 36 2c 20 |0x1401, |0x64E6, |
|00000970| 30 78 37 34 43 37 2c 20 | 30 78 34 34 41 34 2c 20 |0x74C7, |0x44A4, |
|00000980| 30 78 35 34 38 35 2c 0d | 09 30 78 41 35 36 41 2c |0x5485,.|.0xA56A,|
|00000990| 20 30 78 42 35 34 42 2c | 20 30 78 38 35 32 38 2c | 0xB54B,| 0x8528,|
|000009a0| 20 30 78 39 35 30 39 2c | 20 30 78 45 35 45 45 2c | 0x9509,| 0xE5EE,|
|000009b0| 20 30 78 46 35 43 46 2c | 20 30 78 43 35 41 43 2c | 0xF5CF,| 0xC5AC,|
|000009c0| 20 30 78 44 35 38 44 2c | 0d 09 30 78 33 36 35 33 | 0xD58D,|..0x3653|
|000009d0| 2c 20 30 78 32 36 37 32 | 2c 20 30 78 31 36 31 31 |, 0x2672|, 0x1611|
|000009e0| 2c 20 30 78 30 36 33 30 | 2c 20 30 78 37 36 44 37 |, 0x0630|, 0x76D7|
|000009f0| 2c 20 30 78 36 36 46 36 | 2c 20 30 78 35 36 39 35 |, 0x66F6|, 0x5695|
|00000a00| 2c 20 30 78 34 36 42 34 | 2c 0d 09 30 78 42 37 35 |, 0x46B4|,..0xB75|
|00000a10| 42 2c 20 30 78 41 37 37 | 41 2c 20 30 78 39 37 31 |B, 0xA77|A, 0x971|
|00000a20| 39 2c 20 30 78 38 37 33 | 38 2c 20 30 78 46 37 44 |9, 0x873|8, 0xF7D|
|00000a30| 46 2c 20 30 78 45 37 46 | 45 2c 20 30 78 44 37 39 |F, 0xE7F|E, 0xD79|
|00000a40| 44 2c 20 30 78 43 37 42 | 43 2c 0d 09 30 78 34 38 |D, 0xC7B|C,..0x48|
|00000a50| 43 34 2c 20 30 78 35 38 | 45 35 2c 20 30 78 36 38 |C4, 0x58|E5, 0x68|
|00000a60| 38 36 2c 20 30 78 37 38 | 41 37 2c 20 30 78 30 38 |86, 0x78|A7, 0x08|
|00000a70| 34 30 2c 20 30 78 31 38 | 36 31 2c 20 30 78 32 38 |40, 0x18|61, 0x28|
|00000a80| 30 32 2c 20 30 78 33 38 | 32 33 2c 0d 09 30 78 43 |02, 0x38|23,..0xC|
|00000a90| 39 43 43 2c 20 30 78 44 | 39 45 44 2c 20 30 78 45 |9CC, 0xD|9ED, 0xE|
|00000aa0| 39 38 45 2c 20 30 78 46 | 39 41 46 2c 20 30 78 38 |98E, 0xF|9AF, 0x8|
|00000ab0| 39 34 38 2c 20 30 78 39 | 39 36 39 2c 20 30 78 41 |948, 0x9|969, 0xA|
|00000ac0| 39 30 41 2c 20 30 78 42 | 39 32 42 2c 0d 09 30 78 |90A, 0xB|92B,..0x|
|00000ad0| 35 41 46 35 2c 20 30 78 | 34 41 44 34 2c 20 30 78 |5AF5, 0x|4AD4, 0x|
|00000ae0| 37 41 42 37 2c 20 30 78 | 36 41 39 36 2c 20 30 78 |7AB7, 0x|6A96, 0x|
|00000af0| 31 41 37 31 2c 20 30 78 | 30 41 35 30 2c 20 30 78 |1A71, 0x|0A50, 0x|
|00000b00| 33 41 33 33 2c 20 30 78 | 32 41 31 32 2c 0d 09 30 |3A33, 0x|2A12,..0|
|00000b10| 78 44 42 46 44 2c 20 30 | 78 43 42 44 43 2c 20 30 |xDBFD, 0|xCBDC, 0|
|00000b20| 78 46 42 42 46 2c 20 30 | 78 45 42 39 45 2c 20 30 |xFBBF, 0|xEB9E, 0|
|00000b30| 78 39 42 37 39 2c 20 30 | 78 38 42 35 38 2c 20 30 |x9B79, 0|x8B58, 0|
|00000b40| 78 42 42 33 42 2c 20 30 | 78 41 42 31 41 2c 0d 09 |xBB3B, 0|xAB1A,..|
|00000b50| 30 78 36 43 41 36 2c 20 | 30 78 37 43 38 37 2c 20 |0x6CA6, |0x7C87, |
|00000b60| 30 78 34 43 45 34 2c 20 | 30 78 35 43 43 35 2c 20 |0x4CE4, |0x5CC5, |
|00000b70| 30 78 32 43 32 32 2c 20 | 30 78 33 43 30 33 2c 20 |0x2C22, |0x3C03, |
|00000b80| 30 78 30 43 36 30 2c 20 | 30 78 31 43 34 31 2c 0d |0x0C60, |0x1C41,.|
|00000b90| 09 30 78 45 44 41 45 2c | 20 30 78 46 44 38 46 2c |.0xEDAE,| 0xFD8F,|
|00000ba0| 20 30 78 43 44 45 43 2c | 20 30 78 44 44 43 44 2c | 0xCDEC,| 0xDDCD,|
|00000bb0| 20 30 78 41 44 32 41 2c | 20 30 78 42 44 30 42 2c | 0xAD2A,| 0xBD0B,|
|00000bc0| 20 30 78 38 44 36 38 2c | 20 30 78 39 44 34 39 2c | 0x8D68,| 0x9D49,|
|00000bd0| 0d 09 30 78 37 45 39 37 | 2c 20 30 78 36 45 42 36 |..0x7E97|, 0x6EB6|
|00000be0| 2c 20 30 78 35 45 44 35 | 2c 20 30 78 34 45 46 34 |, 0x5ED5|, 0x4EF4|
|00000bf0| 2c 20 30 78 33 45 31 33 | 2c 20 30 78 32 45 33 32 |, 0x3E13|, 0x2E32|
|00000c00| 2c 20 30 78 31 45 35 31 | 2c 20 30 78 30 45 37 30 |, 0x1E51|, 0x0E70|
|00000c10| 2c 0d 09 30 78 46 46 39 | 46 2c 20 30 78 45 46 42 |,..0xFF9|F, 0xEFB|
|00000c20| 45 2c 20 30 78 44 46 44 | 44 2c 20 30 78 43 46 46 |E, 0xDFD|D, 0xCFF|
|00000c30| 43 2c 20 30 78 42 46 31 | 42 2c 20 30 78 41 46 33 |C, 0xBF1|B, 0xAF3|
|00000c40| 41 2c 20 30 78 39 46 35 | 39 2c 20 30 78 38 46 37 |A, 0x9F5|9, 0x8F7|
|00000c50| 38 2c 0d 09 30 78 39 31 | 38 38 2c 20 30 78 38 31 |8,..0x91|88, 0x81|
|00000c60| 41 39 2c 20 30 78 42 31 | 43 41 2c 20 30 78 41 31 |A9, 0xB1|CA, 0xA1|
|00000c70| 45 42 2c 20 30 78 44 31 | 30 43 2c 20 30 78 43 31 |EB, 0xD1|0C, 0xC1|
|00000c80| 32 44 2c 20 30 78 46 31 | 34 45 2c 20 30 78 45 31 |2D, 0xF1|4E, 0xE1|
|00000c90| 36 46 2c 0d 09 30 78 31 | 30 38 30 2c 20 30 78 30 |6F,..0x1|080, 0x0|
|00000ca0| 30 41 31 2c 20 30 78 33 | 30 43 32 2c 20 30 78 32 |0A1, 0x3|0C2, 0x2|
|00000cb0| 30 45 33 2c 20 30 78 35 | 30 30 34 2c 20 30 78 34 |0E3, 0x5|004, 0x4|
|00000cc0| 30 32 35 2c 20 30 78 37 | 30 34 36 2c 20 30 78 36 |025, 0x7|046, 0x6|
|00000cd0| 30 36 37 2c 0d 09 30 78 | 38 33 42 39 2c 20 30 78 |067,..0x|83B9, 0x|
|00000ce0| 39 33 39 38 2c 20 30 78 | 41 33 46 42 2c 20 30 78 |9398, 0x|A3FB, 0x|
|00000cf0| 42 33 44 41 2c 20 30 78 | 43 33 33 44 2c 20 30 78 |B3DA, 0x|C33D, 0x|
|00000d00| 44 33 31 43 2c 20 30 78 | 45 33 37 46 2c 20 30 78 |D31C, 0x|E37F, 0x|
|00000d10| 46 33 35 45 2c 0d 09 30 | 78 30 32 42 31 2c 20 30 |F35E,..0|x02B1, 0|
|00000d20| 78 31 32 39 30 2c 20 30 | 78 32 32 46 33 2c 20 30 |x1290, 0|x22F3, 0|
|00000d30| 78 33 32 44 32 2c 20 30 | 78 34 32 33 35 2c 20 30 |x32D2, 0|x4235, 0|
|00000d40| 78 35 32 31 34 2c 20 30 | 78 36 32 37 37 2c 20 30 |x5214, 0|x6277, 0|
|00000d50| 78 37 32 35 36 2c 0d 09 | 30 78 42 35 45 41 2c 20 |x7256,..|0xB5EA, |
|00000d60| 30 78 41 35 43 42 2c 20 | 30 78 39 35 41 38 2c 20 |0xA5CB, |0x95A8, |
|00000d70| 30 78 38 35 38 39 2c 20 | 30 78 46 35 36 45 2c 20 |0x8589, |0xF56E, |
|00000d80| 30 78 45 35 34 46 2c 20 | 30 78 44 35 32 43 2c 20 |0xE54F, |0xD52C, |
|00000d90| 30 78 43 35 30 44 2c 0d | 09 30 78 33 34 45 32 2c |0xC50D,.|.0x34E2,|
|00000da0| 20 30 78 32 34 43 33 2c | 20 30 78 31 34 41 30 2c | 0x24C3,| 0x14A0,|
|00000db0| 20 30 78 30 34 38 31 2c | 20 30 78 37 34 36 36 2c | 0x0481,| 0x7466,|
|00000dc0| 20 30 78 36 34 34 37 2c | 20 30 78 35 34 32 34 2c | 0x6447,| 0x5424,|
|00000dd0| 20 30 78 34 34 30 35 2c | 0d 09 30 78 41 37 44 42 | 0x4405,|..0xA7DB|
|00000de0| 2c 20 30 78 42 37 46 41 | 2c 20 30 78 38 37 39 39 |, 0xB7FA|, 0x8799|
|00000df0| 2c 20 30 78 39 37 42 38 | 2c 20 30 78 45 37 35 46 |, 0x97B8|, 0xE75F|
|00000e00| 2c 20 30 78 46 37 37 45 | 2c 20 30 78 43 37 31 44 |, 0xF77E|, 0xC71D|
|00000e10| 2c 20 30 78 44 37 33 43 | 2c 0d 09 30 78 32 36 44 |, 0xD73C|,..0x26D|
|00000e20| 33 2c 20 30 78 33 36 46 | 32 2c 20 30 78 30 36 39 |3, 0x36F|2, 0x069|
|00000e30| 31 2c 20 30 78 31 36 42 | 30 2c 20 30 78 36 36 35 |1, 0x16B|0, 0x665|
|00000e40| 37 2c 20 30 78 37 36 37 | 36 2c 20 30 78 34 36 31 |7, 0x767|6, 0x461|
|00000e50| 35 2c 20 30 78 35 36 33 | 34 2c 0d 09 30 78 44 39 |5, 0x563|4,..0xD9|
|00000e60| 34 43 2c 20 30 78 43 39 | 36 44 2c 20 30 78 46 39 |4C, 0xC9|6D, 0xF9|
|00000e70| 30 45 2c 20 30 78 45 39 | 32 46 2c 20 30 78 39 39 |0E, 0xE9|2F, 0x99|
|00000e80| 43 38 2c 20 30 78 38 39 | 45 39 2c 20 30 78 42 39 |C8, 0x89|E9, 0xB9|
|00000e90| 38 41 2c 20 30 78 41 39 | 41 42 2c 0d 09 30 78 35 |8A, 0xA9|AB,..0x5|
|00000ea0| 38 34 34 2c 20 30 78 34 | 38 36 35 2c 20 30 78 37 |844, 0x4|865, 0x7|
|00000eb0| 38 30 36 2c 20 30 78 36 | 38 32 37 2c 20 30 78 31 |806, 0x6|827, 0x1|
|00000ec0| 38 43 30 2c 20 30 78 30 | 38 45 31 2c 20 30 78 33 |8C0, 0x0|8E1, 0x3|
|00000ed0| 38 38 32 2c 20 30 78 32 | 38 41 33 2c 0d 09 30 78 |882, 0x2|8A3,..0x|
|00000ee0| 43 42 37 44 2c 20 30 78 | 44 42 35 43 2c 20 30 78 |CB7D, 0x|DB5C, 0x|
|00000ef0| 45 42 33 46 2c 20 30 78 | 46 42 31 45 2c 20 30 78 |EB3F, 0x|FB1E, 0x|
|00000f00| 38 42 46 39 2c 20 30 78 | 39 42 44 38 2c 20 30 78 |8BF9, 0x|9BD8, 0x|
|00000f10| 41 42 42 42 2c 20 30 78 | 42 42 39 41 2c 0d 09 30 |ABBB, 0x|BB9A,..0|
|00000f20| 78 34 41 37 35 2c 20 30 | 78 35 41 35 34 2c 20 30 |x4A75, 0|x5A54, 0|
|00000f30| 78 36 41 33 37 2c 20 30 | 78 37 41 31 36 2c 20 30 |x6A37, 0|x7A16, 0|
|00000f40| 78 30 41 46 31 2c 20 30 | 78 31 41 44 30 2c 20 30 |x0AF1, 0|x1AD0, 0|
|00000f50| 78 32 41 42 33 2c 20 30 | 78 33 41 39 32 2c 0d 09 |x2AB3, 0|x3A92,..|
|00000f60| 30 78 46 44 32 45 2c 20 | 30 78 45 44 30 46 2c 20 |0xFD2E, |0xED0F, |
|00000f70| 30 78 44 44 36 43 2c 20 | 30 78 43 44 34 44 2c 20 |0xDD6C, |0xCD4D, |
|00000f80| 30 78 42 44 41 41 2c 20 | 30 78 41 44 38 42 2c 20 |0xBDAA, |0xAD8B, |
|00000f90| 30 78 39 44 45 38 2c 20 | 30 78 38 44 43 39 2c 0d |0x9DE8, |0x8DC9,.|
|00000fa0| 09 30 78 37 43 32 36 2c | 20 30 78 36 43 30 37 2c |.0x7C26,| 0x6C07,|
|00000fb0| 20 30 78 35 43 36 34 2c | 20 30 78 34 43 34 35 2c | 0x5C64,| 0x4C45,|
|00000fc0| 20 30 78 33 43 41 32 2c | 20 30 78 32 43 38 33 2c | 0x3CA2,| 0x2C83,|
|00000fd0| 20 30 78 31 43 45 30 2c | 20 30 78 30 43 43 31 2c | 0x1CE0,| 0x0CC1,|
|00000fe0| 0d 09 30 78 45 46 31 46 | 2c 20 30 78 46 46 33 45 |..0xEF1F|, 0xFF3E|
|00000ff0| 2c 20 30 78 43 46 35 44 | 2c 20 30 78 44 46 37 43 |, 0xCF5D|, 0xDF7C|
|00001000| 2c 20 30 78 41 46 39 42 | 2c 20 30 78 42 46 42 41 |, 0xAF9B|, 0xBFBA|
|00001010| 2c 20 30 78 38 46 44 39 | 2c 20 30 78 39 46 46 38 |, 0x8FD9|, 0x9FF8|
|00001020| 2c 0d 09 30 78 36 45 31 | 37 2c 20 30 78 37 45 33 |,..0x6E1|7, 0x7E3|
|00001030| 36 2c 20 30 78 34 45 35 | 35 2c 20 30 78 35 45 37 |6, 0x4E5|5, 0x5E7|
|00001040| 34 2c 20 30 78 32 45 39 | 33 2c 20 30 78 33 45 42 |4, 0x2E9|3, 0x3EB|
|00001050| 32 2c 20 30 78 30 45 44 | 31 2c 20 30 78 31 45 46 |2, 0x0ED|1, 0x1EF|
|00001060| 30 0d 7d 3b 0d 0d 75 6e | 73 69 67 6e 65 64 20 73 |0.};..un|signed s|
|00001070| 68 6f 72 74 20 43 61 6c | 63 43 52 43 28 0d 09 72 |hort Cal|cCRC(..r|
|00001080| 65 67 69 73 74 65 72 20 | 42 79 74 65 20 2a 70 74 |egister |Byte *pt|
|00001090| 72 2c 0d 09 72 65 67 69 | 73 74 65 72 20 75 6e 73 |r,..regi|ster uns|
|000010a0| 69 67 6e 65 64 20 6c 6f | 6e 67 20 63 6f 75 6e 74 |igned lo|ng count|
|000010b0| 2c 0d 09 72 65 67 69 73 | 74 65 72 20 75 6e 73 69 |,..regis|ter unsi|
|000010c0| 67 6e 65 64 20 73 68 6f | 72 74 20 63 72 63 29 0d |gned sho|rt crc).|
|000010d0| 7b 0d 09 77 68 69 6c 65 | 20 28 63 6f 75 6e 74 2d |{..while| (count-|
|000010e0| 2d 20 3e 20 30 29 0d 09 | 09 63 72 63 20 3d 20 54 |- > 0)..|.crc = T|
|000010f0| 61 62 6c 65 5b 28 28 63 | 72 63 20 3e 3e 20 38 29 |able[((c|rc >> 8)|
|00001100| 20 5e 20 2a 70 74 72 2b | 2b 29 20 26 20 30 78 46 | ^ *ptr+|+) & 0xF|
|00001110| 46 5d 20 5e 20 28 63 72 | 63 20 3c 3c 20 38 29 3b |F] ^ (cr|c << 8);|
|00001120| 0d 09 72 65 74 75 72 6e | 20 63 72 63 3b 0d 7d 0d |..return| crc;.}.|
|00001130| 0d 75 6e 73 69 67 6e 65 | 64 20 73 68 6f 72 74 20 |.unsigne|d short |
|00001140| 55 70 64 61 74 65 43 52 | 43 28 0d 09 72 65 67 69 |UpdateCR|C(..regi|
|00001150| 73 74 65 72 20 42 79 74 | 65 20 62 2c 0d 09 72 65 |ster Byt|e b,..re|
|00001160| 67 69 73 74 65 72 20 75 | 6e 73 69 67 6e 65 64 20 |gister u|nsigned |
|00001170| 73 68 6f 72 74 20 63 72 | 63 29 0d 7b 0d 09 72 65 |short cr|c).{..re|
|00001180| 74 75 72 6e 20 54 61 62 | 6c 65 5b 28 28 63 72 63 |turn Tab|le[((crc|
|00001190| 20 3e 3e 20 38 29 20 5e | 20 62 29 20 26 20 30 78 | >> 8) ^| b) & 0x|
|000011a0| 46 46 5d 20 5e 20 28 63 | 72 63 20 3c 3c 20 38 29 |FF] ^ (c|rc << 8)|
|000011b0| 3b 0d 7d 0d 0d 23 65 6e | 64 69 66 0d 00 00 00 00 |;.}..#en|dif.....|
|000011c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000011d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000011e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000011f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001200| 00 00 01 00 00 00 01 4a | 00 00 00 4a 00 00 00 32 |.......J|...J...2|
|00001210| 51 44 45 4c 41 59 09 32 | 09 09 2f 2a 20 42 65 66 |QDELAY.2|../* Bef|
|00001220| 6f 72 65 20 61 6e 73 77 | 65 72 69 6e 67 20 45 4e |ore answ|ering EN|
|00001230| 05 43 52 43 2e 63 02 00 | 00 00 50 61 72 74 53 49 |.CRC.c..|..PartSI|
|00001240| 54 78 00 00 00 00 00 00 | 00 00 00 01 18 b7 00 00 |Tx......|........|
|00001250| 00 00 50 61 72 74 53 49 | 54 78 00 00 00 00 00 00 |..PartSI|Tx......|
|00001260| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001270| 00 00 a7 d3 7d fb 00 00 | 00 00 00 00 01 7c 65 66 |....}...|.....|ef|
|00001280| 69 6e 65 20 43 4c 4f 53 | 45 57 09 09 69 66 20 28 |ine CLOS|EW..if (|
|00001290| 56 65 72 73 29 20 42 69 | 6e 43 6c 6f 73 65 57 72 |Vers) Bi|nCloseWr|
|000012a0| 69 74 65 28 29 3b 5c 0d | 09 09 09 09 09 65 6c 73 |ite();\.|.....els|
|000012b0| 65 20 7b 20 46 53 43 6c | 6f 73 65 28 72 65 66 29 |e { FSCl|ose(ref)|
|000012c0| 3b 20 46 6c 75 73 68 56 | 6f 6c 28 30 2c 20 76 6f |; FlushV|ol(0, vo|
|000012d0| 6c 75 6d 65 29 3b 20 7d | 0d 23 64 65 66 69 6e 65 |lume); }|.#define|
|000012e0| 20 47 45 54 45 4f 46 09 | 09 69 66 20 28 56 65 72 | GETEOF.|.if (Ver|
|000012f0| 73 29 20 42 69 6e 47 65 | 74 45 4f 46 28 26 45 6f |s) BinGe|tEOF(&Eo|
|00001300| 00 00 00 46 00 04 00 00 | 05 58 00 00 05 5f 07 43 |...F....|.X..._.C|
|00001310| 61 6c 63 43 52 43 00 00 | 06 a8 00 00 06 b1 09 55 |alcCRC..|.......U|
|00001320| 70 64 61 74 65 43 52 43 | 00 00 0f f5 00 00 0f fc |pdateCRC|........|
|00001330| 07 43 61 6c 63 43 52 43 | 00 00 10 c0 00 00 10 c9 |.CalcCRC|........|
|00001340| 09 55 70 64 61 74 65 43 | 52 43 00 00 01 00 00 00 |.UpdateC|RC......|
|00001350| 01 4a 00 00 00 4a 00 00 | 00 32 00 6e 83 a8 07 5a |.J...J..|.2.n...Z|
|00001360| 00 00 00 1c 00 32 00 00 | 4d 50 53 52 00 00 00 0a |.....2..|MPSR....|
|00001370| 03 ef ff ff 00 00 00 00 | 00 6e b3 ec 00 00 00 00 |........|.n......|
+--------+-------------------------+-------------------------+--------+--------+